<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<%
	String path = request.getContextPath();
	// 获得本项目的地址(例如: http://localhost:8080/MyApp/)赋值给basePath变量 
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	// 将 "项目路径basePath" 放入pageContext中，待以后用EL表达式读出。 
	pageContext.setAttribute("basePath", basePath);
	//out.write(basePath);
%>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>学生信息添加</title>

<meta name="description"
	content="Source code generated using layoutit.com">
<meta name="author" content="LayoutIt!">

<link href="<%=basePath%>bootstrap/css/bootstrap.min.css"
	rel="stylesheet">
<link href="<%=basePath%>bootstrap/css/style.css" rel="stylesheet">



<!--派生选择器设置提示信息的字体颜色-->
<style type="text/css">
div span {
	color: red;
}
</style>
<script src="<%=basePath%>bootstrap/js/jquery.min.js"></script>
<script src="<%=basePath%>bootstrap/js/bootstrap.min.js"></script>
<script src="<%=basePath%>bootstrap/js/scripts.js"></script>
<script type="text/javascript">
	//成绩非空验证
	function checkScore() {
		//获取输入的内容
		var inputStuScore = document.getElementById("inputStuScore").value;
		//错误提示框信息内容
		var spStuScore = document.getElementById("spStuScore");
		if (inputStuScore == null || inputStuScore == "") {
			//提示信息
			spStuScore.innerHTML = "请输入成绩！";
			//改变标志量
			return false;
		} else {
			//清空提示信息
			spStuScore.innerHTML = "";
			return true;
		}
	}
	//进行最后的提交验证
	function checkAll() {

		var ischScore = checkScore();

		if (ischScore) {
			return true;
		} else {
			return false;
		}
	}
</script>
</head>
<body>

	<div id="container" align="center">
		<div style="width: 500px;" align="left">
			<h4 align="center">给定成绩页面</h4>
			<form class="form-horizontal" role="form"
				action="<%=basePath%>CommitStuScore" method="post">


				<div class="form-group">
					<label for="inputStuName" class="col-sm-2 control-label">学生名&nbsp;</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" id="inputStuName"
							name="inputStuName" value="${requestScope.stuBean.stuname}" readonly>
					</div>
				</div>

				<div class="form-group">
					<label for="inputPassword3" class="col-sm-2 control-label">课程名&nbsp;</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" id="inputPassword3"
							name="inputPassword3" value="${requestScope.stuBean.classname}" readonly>

					</div>
				</div>

				<div class="form-group">
					<label for="inputStuTel" class="col-sm-2 control-label">教师名&nbsp;</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" id="inputStuTel"
							name="inputStuTel" value="${requestScope.stuBean.teaname}" readonly>

					</div>
				</div>

				<div class="form-group">
					<label for="inputStuAdress" class="col-sm-2 control-label">成绩&nbsp;&nbsp;</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" id="inputStuScore"
							name="inputStuScore" placeholder=成绩 onblur="checkScore();">
						<div>
							<span id="spStuScore"></span>
						</div>
					</div>
				</div>

				<div class="form-group">
					<div class="col-sm-offset-2 col-sm-10">
						<button type="submit" class="btn btn-default"
							onclick="return checkAll();">提交</button>
					</div>
				</div>
			</form>
		</div>
	</div>



</body>
</html>